<!DOCTYPE html>
<html lang="zh">
<head>
    <th:block th:include="include :: header('图片上传')"/>
</head>
<body>
<div id="wrapper" class="gray-bg">
    <form class="form-horizontal m" enctype="multipart/form-data">
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">图片：</label>
                <!--                 onclick="$.triggerFileInput()"-->
                <div class="UploadImg">  <!-- 为整个区域添加点击事件 -->
                    <div class="imgList" id="imgList">
                        <!-- 这里用于显示已上传的图片或加载状态 -->
                    </div>
                    <div class="addBtn" id="addBtn">
                        <i class="fa fa-plus"></i>
                    </div>
                </div>
                <!--                 onchange="$.uploadImage()"-->
                <input type="file" id="fileInput" style="display: none;"/>
                <!-- 隐藏的文件输入元素，并绑定 onchange 事件 -->
                <input name="imgUrl" id="imgUrl" class="form-control" type="hidden">
            </div>
        </div>
    </form>
</div>
</body>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var uploadUrl = ctx + "common/upload";
    var downloadUrl = ctx + "common/download";

    $(document).ready(function () {
        $.fileUpload.init();
    });
</script>
</html>